package com.thb.pay.system.controller;


import com.thb.pay.api.sys.SysLogServiceApi;
import com.thb.pay.api.sys.vo.req.SysLogPageReq;
import com.thb.pay.api.sys.vo.req.SysLogReq;
import com.thb.pay.api.sys.vo.resp.SysLogVo;
import com.thb.pay.core.utils.PageResult;
import com.thb.pay.system.entity.SysLog;
import com.thb.pay.system.service.SysLogService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 系统-操作日志表 前端控制器
 * </p>
 *
 * @author lucky
 * @since 2019-07-21
 */
@RestController
public class SysLogController implements SysLogServiceApi {

    @Autowired
    private SysLogService sysLogService;

    @Override
    public PageResult<SysLogVo> findPage(@RequestBody SysLogPageReq pageReq) {
        return sysLogService.findPage(pageReq);
    }

    @Override
    public void addLog(@RequestBody SysLogReq logReq) {
        SysLog sysLog = new SysLog();
        BeanUtils.copyProperties(logReq, sysLog);
        sysLogService.insert(sysLog);
    }
}
